package com.serviceprovider.business.module.admin.bonus.model;

//~--- JDK imports ------------------------------------------------------------

import java.util.ArrayList;
import java.util.List;

public class BonusDetails {
    private List<Double> desiredAmounts = new ArrayList<Double>();
    private List<Double> flatRates      = new ArrayList<Double>();
    private List<Double> percentRates   = new ArrayList<Double>();
    private Integer      bonusId;
    private Integer      id;

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof BonusDetails)) {
            return false;
        }

        BonusDetails b  = (BonusDetails) obj;
        boolean      eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        eq = ((bonusId == null) && (b.bonusId == null)) || ((bonusId != null) && bonusId.equals(b.bonusId));

        if (!eq) {
            return false;
        }

        eq = ((desiredAmounts == null) && (b.desiredAmounts == null))
             || ((desiredAmounts != null) && desiredAmounts.equals(b.desiredAmounts));

        if (!eq) {
            return false;
        }

        eq = ((flatRates == null) && (b.flatRates == null)) || ((flatRates != null) && flatRates.equals(b.flatRates));

        if (!eq) {
            return false;
        }

        eq = ((percentRates == null) && (b.percentRates == null))
             || ((percentRates != null) && percentRates.equals(b.percentRates));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + ((id == null)
                                   ? 0
                                   : id.hashCode());
        result = prime * result + ((bonusId == null)
                                   ? 0
                                   : bonusId.hashCode());
        result = prime * result + ((desiredAmounts == null)
                                   ? 0
                                   : desiredAmounts.hashCode());
        result = prime * result + ((flatRates == null)
                                   ? 0
                                   : flatRates.hashCode());
        result = prime * result + ((percentRates == null)
                                   ? 0
                                   : percentRates.hashCode());

        return result;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBonusId() {
        return bonusId;
    }

    public void setBonusId(Integer bonusId) {
        this.bonusId = bonusId;
    }

    public List<Double> getDesiredAmounts() {
        return desiredAmounts;
    }

    public void setDesiredAmounts(List<Double> desiredAmounts) {
        this.desiredAmounts = desiredAmounts;
    }

    public List<Double> getFlatRates() {
        return flatRates;
    }

    public void setFlatRates(List<Double> flatRates) {
        this.flatRates = flatRates;
    }

    public List<Double> getPercentRates() {
        return percentRates;
    }

    public void setPercentRates(List<Double> percentRates) {
        this.percentRates = percentRates;
    }
}



